<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>捷报考勤创建企业帐号</title>

<!-- Bootstrap -->
<link href="static/plugins/bootstrap3.3.7/css/bootstrap.min.css"
	rel="stylesheet">
	<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="static/plugins/bootstrap-select/css/bootstrap-select.min.css">

<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
      <script src="https://cdn.bootcss.com/html5shiv/3.7.3/html5shiv.min.js"></script>
      <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
<style type="text/css">
body {
	padding-top: 10px;
	padding-bottom: 40px;
	background-color: #f5f5f5;
}

.form-enterprise {
	max-width: 350px;
	padding: 5px 29px 29px;
	margin: 0 auto 20px;
	background-color: #fff;
	border: 1px solid #e5e5e5;
	-webkit-border-radius: 5px;
	-moz-border-radius: 5px;
	border-radius: 5px;
	-webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
	-moz-box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
	box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
}

.form-enterprise .form-enterprise-heading,.form-enterprise .checkbox {
	margin-bottom: 10px;
}

.form-enterprise input[type="text"],.form-enterprise input[type="password"] {
	font-size: 16px;
	height: auto;
	margin-bottom: 15px;
	padding: 5px 5px;
    width: 100%;
}

.form-enterprise-heading {
	text-align: center;
}

.enterprise-submit-btn {
	width: 100%;
/*     padding: 5px 5px; */
}
    
</style>
</head>
<body>
	<div class="container">
		<div class="row">
				<form class="form-enterprise" id="enterpriseForm">
					<h2 class="form-enterprise-heading">企业信息</h2>
					<input type="text" class="input-block-level" name="name" id="name"
						placeholder="请输入企业名称"> 
					<input type="text" class="input-block-level" name="simpleName" id="simpleName"
						placeholder="请输入企业简称" style="margin-bottom:15px;"> 
					

					<select class="selectpicker" data-width="100%" title="请选择行业类型" id="industryType">
					  <optgroup label="IT行业">
					    <option>计算机软件/硬件/服务</option>
					    <option>互联网</option>
					  </optgroup>
					  <optgroup label="医疗">
					    <option>医疗制造</option>
					    <option>医院医疗机构</option>
					  </optgroup>
					</select>

					
					<h2 class="form-enterprise-heading">管理员</h2>
					<input type="text" class="input-block-level" name="adminName" id="adminName"
						placeholder="请输入姓名">
					
					<!-- Split button -->
					<select class="selectpicker" data-width="100%" title="请选择性别" id="adminSex">
					  <option>男</option>
					  <option>女</option>
					</select>

					
					<input type="text" class="input-block-level" name="adminTel" style="margin-top:15px;"
						placeholder="请输入手机号码" id="adminTel"> 
					<input type="text" class="input-block-level" name="adminEmail" id="adminEmail"
						placeholder="请输入邮箱"> 
					
					<div class="row">
						<div class="col-md-4">
							<input type="text" name="adminCaptcha" id="adminCaptcha"
							class="input-block-level" placeholder="验证码">
						</div>
						<div class="col-md-8">
							<button class="btn btn-large btn-primary" type="button" style="margin-bottom: 15px;">获取短信验证码(60s)</button>
						
						</div>
					</div>
					<input type="password" name="adminPwd" id="adminPwd"
						class="input-block-level" placeholder="请输入密码">
					<br />
					<button class="btn btn-large btn-primary enterprise-submit-btn" type="button" onclick="createEnterprise()">提交</button>
				</form>
		</div>
	</div>
	<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
	<script src="static/plugins/jquery/jquery-1.12.4.min.js"></script>
	<!-- Include all compiled plugins (below), or include individual files as needed -->
	<script src="static/plugins/bootstrap3.3.7/js/bootstrap.min.js"></script>

	<!-- Latest compiled and minified JavaScript -->
	<script src="static/plugins/bootstrap-select/js/bootstrap-select.min.js"></script>
	
	
</body>
<script type="text/javascript">

	function createEnterprise() {
// 		if ($("input[name='loginName']").val() == "") {
// 			showError("帐号不能为空，请输入");
// 			$("input[name='loginName']").focus();
// 			return;
// 		} 
// 		if($("input[name='password']").val() == "") {
// 			showError("密码不能为空，请输入");
// 			$("input[name='password']").focus();
// 			return;
// 		}


		var data = {
			name:$('#name').val(),
			simpleName:$('#simpleName').val(),
			industryType:$('#industryType').selectpicker('val'),
			adminTel:$('#adminTel').val(),
			adminEmail:$('#adminEmail').val(),
			adminName:$('#adminName').val(),
			adminPwd:$('#adminPwd').val(),
			adminSex:$('#adminSex').selectpicker('val'),
		};
		
		console.log(data);
		
// 		console.log($('#industryType').selectpicker('val'));
		
// 		console.log($('#adminSex').selectpicker('val'));
		
		//ajax异步提交  
		$.ajax({
			type : "POST",
			url : "att.action?createAccount",
			data : data, //序列化               
			error : function(request) { // 设置表单提交出错 
				alert('注册错误'); //登录错误提示信息
			},
			success : function(data) {
				var d = $.parseJSON(data);
				if (d.success) {
// 					window.location.href='main.do?main';
					alert(d.msg);
				} else {
					alert(d.msg)
				}
				
			}
		});
	}
</script>
</html>